home *** CD-ROM | disk | FTP | other *** search
- /* This file contains all the defs and protos for the speech additions to AppWannaBe.
- The idea is to show them separate so that it is easy to find them and it is also easy
- to see what is different from the original sample code.
-
- Written by: Guillermo A. Ortiz AppleSoft Developer Technical Support
- Date: 08/04/93
- */
- #ifndef __WANNASPEECH__
- #define __WANNASPEECH__
-
- #include <Speech.h>
- #include <StdTTS.h>
-
- /* this is used to keep track of the location of the next spoke word */
- struct WordLimits{
- Boolean hilite;
- short wordStart;
- short wordEnd;
- };
- typedef struct WordLimits WordLimits;
- typedef WordLimits *WordLimitsPtr;
- typedef WordLimitsPtr *WordLimitsHandle;
-
- #define soGalaSynthID 'gala'
- #define soGalaConvertToAllo 'cval' // Convert to allophones.
-
- typedef struct GTXtndData { // Extended info for several selectors.
- OSType synthID; // soGalaSynthID ('gala').
- OSType selector; // Extended selector (e.g. 'frac').
- long info2; // Extended information or pointer to it.
- } GTXtndData;
-
-
- typedef struct GTXtndConvertData { // Extended info for conversion selectors.
- // input values
- OSType synthID; // soGalaSynthID ('gala').
- OSType selector; // Extended selector ('cval' or 'cvwv').
- Ptr inputBuffer; // Address of the data to convert.
- long inputLen; // Length of the data to convert.
- long controlFlags; // 0 (for last buffer) or kNoEndingProsody.
- Handle outputBuffer; // Handle to buffer for the output.
- // return values
- long outputLen; // Returns the size of the output.
- Boolean moreOutput; // Returns true if outputBuffer is too small
- // for all the output at at once.
- } GTXtndConvertData;
-
-
- #define mSpeech 131
- #define kSayIt 1
- #define kMakePhonemes 2
- #define kMakeAllophones 3
- #define kPickVoice 5
-
- #define kTextCtl 100
- #define kPhonemeCtl 101
- #define kPhonemeLst 102
- #define kVoiceName 103
- #define kModeName 104
-
- #define aVoiceFailed 300
-
- /************** WannaSpeech.c **************/
-
- void DoSayIt(FileRecHndl frHndl);
- void DoMakePhonemes(FileRecHndl frHndl);
- void DoMakeAllophones(FileRecHndl frHndl);
- ComponentInstance OpenStdTTS(void);
- void SetVoice(FileRecHndl frHndl);
- void CreatePhonemesList(WindowPtr wind);
- Boolean SpeechAvailable(void);
- pascal void MyWordCallback(SpeechChannel sChannel, WordLimitsPtr wLP, long wordPos, short wordLen);
- OSErr SayText(FileRecHndl frHndl, TEHandle teH);
- void InitDocSpeech(FileRecHndl frHndl);
- void SetTECtlText(WindowPtr window, FileRecHndl frHndl, short ctlNumber, Str255 pstr);
- pascal OSErr TextToAllophones(SpeechChannel channel, Ptr textBuf, long textBytes, Handle allophoneBuf, long *allophoneBytes);
-
- /************** Menus.h ********************/
- Boolean DoAdjustSpeechMenu(WindowPtr window);
-
- #endif
-